<?php
/* SVN FILE: $Id: assignment.php 40 2009-12-24 14:45:29Z kenreily@gmail.com $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * Recenseo: Online submission and reviewing for education
 * Copyright 2008-2009, Ken Reily
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * $Date: 2009-12-24 14:45:29 +0000 (Thu, 24 Dec 2009) $
 * $Revision: 40 $
 * $Author: kenreily@gmail.com $
 * $HeadURL: http://recenseo.googlecode.com/svn/trunk/app/models/assignment.php $
 */
class Assignment extends AppModel {
  var $name = 'Assignment';
  var $hasMany = array('AssignedAssessment','Submission');
  var $belongsTo = 'Course';
  var $hasAndBelongsToMany = array('QualityAttribute','GradingOption');
  var $actsAs = array('Containable');
  
  function getForId($id) 
  {
    return $this->query("SELECT c.id,c.name,a.id,a.name,a.due,a.cutoff " .
                        "FROM assignments AS a JOIN courses AS c ON c.id = a.course_id WHERE a.id = {$id}");
  }
}
?>